General
IIR filters are simulations of real-world analog filters built from resistors capacitors and inductors.
They inherit many of their properties and introduce some new ones unique to digital filters.
The filters presented here require a cutoff frequency input value at the F pin.
The cutoff frequency can be thought of as the reference frequency or the center of the filter's response curve.
Frequencies on either side of the cutoff will be adjusted in a manner specific to the type of filter.
Detail display mode will plot the filter's frequency response on a logarithmic frequency scale from 20Hz to 20KHz.
The circuit must be playing for the display to operate.
The horizontal line represents the 0dB level.
Clipping will occur when internal values of the filter are beyond ±1.0.
This is shown by a red ring around the object.
Use pre-attenuation to prevent clipping.
IIR filters become unstable at 0Hz frequency.
The symptoms will be the output wandering around, possibly bouncing off the clipping limits.
To prevent this, always specify a cutoff frequency.
Changing the type of filter while the circuit is playing may result in short squeal as the internal
parameters are shifted from one filter to another.
Types of Filters
The IIR filter object provides four types of filters:
LP Low Pass filters allow frequencies below the cutoff frequency to pass and reduce frequencies above.
HP High Pass is the opposite of low pass, allowing frequencies above the cutoff to pass and reducing frequencies below.
BP Band Pass filters allow frequencies closed to the cutoff to pass through and reduce frequencies farther away.
BR Band Reject is the opposite of band pass, reducing frequencies closed to the cutoff and allowing frequencies farther away to pass through.
1CP and 1CZ filters are abstractions of analog filters and are included for backwards compatibility.
They represent pairs of poles or zeros located on the z-plane.
The four types of filters are further divided into 1st and 2nd order filters.
1st and 2nd order directly affect the frequency response and the number of control values required to setup the filter.
1st order filters simulate electrical circuits with one frequency reactive component, either an inductor or a capacitor.
These include LP1 and HP1. 1st order filters have only an F input to control the cutoff frequency.
The cutoff frequency is specified at the 3dB point.
2nd order filters simulate circuits with two reactive components.
2nd order filters have an additional L input that controls the damping.
These include LP2 HP2 BP2 and BR2. 1CP and 1CZ are also 2nd order filters.
2nd order filters are resonant filters.
The F input pin specifies the frequency of the resonator, the L input specifies the damping or Q of the resonator.
The damping of the resonator directly effects the amplitude response at the cutoff frequency.
For simple filter applications, an L value of -0.5 results in a smooth frequency response with no peaks or dips.
More demanding filters require cascading several sections, each with slightly different properties.
The exact techniques may be found in any number of reference books and the following formula:
2L = Q = 1/damping
L = log2(Q) = -log2(damping)
Large L values correspond to large Q values which corresponds to lower damping which corresponds to a peak in the frequency response.
Small L values correspond to small Q values which corresponds to higher damping which corresponds to a smoother frequency response.
Large L values will turn low pass and high pass filters into band pass filters.
Large L values for band pass filters will narrow the range of frequencies that are allowed through.
Large L values for band reject filters will narrow the range of frequencies that are not allowed through.
The auto gain setting is available with all 2nd order filters.
It adjusts the filter so that the highest point on the response curve is equal to 1.0.
Auto gain can simplify cascading filters in that it reduces clipping inside the filter.
When designing more complex filters with specific Q values however, be sure to turn auto gain off.
Otherwise the formulas used to design the filter will not be applicable.
Examples
Direct filtering
The filter is set as a low pass at 1000Hz, Auto gain is on.
Frequencies above 1KHz will be reduced by 6dB per octave.
The Q of the filter is 1/sqrt(2).
Boost/Cut Configuration:
Add or subtract the filtered signal with the input signal to boost or cut frequencies.
Using a low pass filter results in a bass control.
Using a high pass filter results in a treble control.
Using a band filter results in a parametric EQ, or one channel of a graphic equalizer.
5th order Chebychev filter:
Suitable for use as an anti-alias filter.
Cascading two 2nd order sections and one 1st order section results in a 5th order filter
with frequency response falling off at 30dB per octave.
A reference book supplied the frequency and Q constants which were plugged into the circuit as equations.
The two LP2 filters have their auto gain setting turned off.
Pre and post gain adjustments are optional and help to reduce clipping.
Technical Details
IIR stands for Infinite Impulse Response,
meaning that the filter will continue to produce an output signal even though the input signal
is not changing. The term infinite, however, is a purely theoretical notion and is
not possible in the domain of digital filters. The output will eventually stop changing
due to roundoff and precision limits.
ABox takes advantage of this by monitoring the filter's activity and shutting it off
when output change falls below a certain level. This means that when presented with
a static input, the output may not be exactly what is expected.
For example, a lowpass filter presented with an input of 0.5, may stop responding when the
output reaches 0.49998. The activity limit was chosen by inspection and may be adjusted
in future versions.
The frequency response of each filter differs slightly from its analog counterpart.
This is due to the bilinear transformation used to convert from analog to digital,
which adds an extra zero to the filter's transfer function.
For lowpass and bandpass filters, the zero is at 22050Hz. Close to this frequency, the response will fall off
much more rapidly than the analog version.
High pass filters have an extra zero at 0Hz, with frequency response also falling off more rapidly.
Corresponding to slightly skewed frequency response is that of slightly skewed phase distortion
around the new zero.
|